#@Time : 2020/12/10 11:28
#@Author: sl
#@File : user_delete.py

from flask import request
from app.v2.models.UserModel import UserSample
from framework import db
from framework.api.AbstractApi import AbstractApi

'''
 get 单表请求示例 根据id删对象 http://127.0.0.1:8181/v2/userDelete?id=1285923099950198854
'''
class UserDelete(AbstractApi):
    def handle_get_request(self):
        user = UserSample()
        user.__dict__.update(request.args)
        db.session.query(UserSample).filter_by(id=user.id).delete()
        return "delete ok"